package com.cost.domain.ok;

import java.io.Serializable;

public class R implements Serializable{
	
	private static final long serialVersionUID = -7459084741931666681L;

	private Integer code;
	private String msg;
	private Object data;
	
	
	public R(){}
	public R(Builder builder){
		this.code = builder.code;
		this.msg = builder.msg;
		this.data = builder.data;
	}
	
	public static class Builder{
		private Integer code;
		private String msg;
		private Object data;
		
		public R ok(){
			R r = new R();
			r.code = 0;
			r.msg = "成功";
			return r;
		}
		
		public R build(){
			this.code = 0;
			this.msg = "成功";
			return new R(this);
		}

		public Integer getCode() {
			return code;
		}

		public Builder setCode(Integer code) {
			this.code = code;
			return this;
		}

		public String getMsg() {
			return msg;
		}

		public Builder setMsg(String msg) {
			this.msg = msg;
			return this;
		}

		public Object getData() {
			return data;
		}

		public Builder setData(Object data) {
			this.data = data;
			return this;
		}
		

	}
	
	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
}
